<template>
    <div class="goods-item">
       <img :src="item.pic" alt="">
       <h4>{{item.name}}</h4>
       <p>{{item.characteristic}}</p>
       <p>{{item.minPrice}}</p>
    </div>
</template>
<script>
export default {
    props:{
        item:{
            type:Object,
             default:[1,2,3,4,5,6],//如果父组件没有传递数据，就显示默认值，如果父组件传递数据，就显示父组件传过来的数据
        },
        aa:{
            type:String
        }
        
       
    },
    setup(props) {
        console.log(props.aa);//props可以获取父组件传过来值
        
    }
   
}
</script>
<style lang="scss" scoped>
.goods-item{
    width: 49%;
   
    img{
        width: 100%;
        height: 216px;
        border-radius: 4px;
    }
    h4{
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
    }
    p{
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
        color: #999;
        margin: 8px 0;
    }

}
</style>
